import request from '@/utils/request'

// 查询想定方案列表（分页）
export function listHistory(query) {
  return request({
    url: '/sources/software/history/page',
    method: 'get',
    params: query
  })
}

// 根据id获取历史详情
export function getHistoryById(id) {
  return request({
    url: '/sources/software/history/' + id,
    method: 'get',
  })
}

// 获取主版本历史详情
// export function getMasterHistoryBySoftwareId(softwareId) {
//   return request({
//     url: '/sources/software/history/master/' + softwareId,
//     method: 'get',
//   })
// }

// 删除全部版本
export function deleteAllHistory(softwareId) {
  return request({
    url: '/sources/software/history/removeAll/' + softwareId,
    method: 'delete',
  })
}

// 回退历史版本
export function rollbackHistory(softwareId) {
  return request({
    url: '/sources/software/history/rollback/' + softwareId,
    method: 'get',
  })
}

// 根据id删除历史
export function deleteHistoryById(id) {
  return request({
    url: '/sources/software/history/' + id,
    method: 'delete',
  })
}